package demo.vo.common;

import java.io.Serializable;

/**
 * 缓存对象的包装类
 * 
 * @author hanjy
 *
 */
public class CachedObject implements Serializable {

    private static final long serialVersionUID = 1L;
    /** 时间戳，比如创建时间或者失效时间 */
    private long timestamp;
    /** 缓存的真实对象 */
    private Object data;

    public CachedObject() {
        super();
    }

    public CachedObject(Object data) {
        super();
        this.data = data;
        this.timestamp = System.currentTimeMillis();
    }

    public CachedObject(Object data, long timestamp) {
        super();
        this.timestamp = timestamp;
        this.data = data;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

}
